package com.example.questionsystem.modules.qu.controller;

import com.example.questionsystem.core.api.ApiRest;
import com.example.questionsystem.core.api.controller.BaseController;
import com.example.questionsystem.modules.qu.entity.Projects;
import com.example.questionsystem.modules.qu.service.ProjectsService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Api(tags = {"项目API"})
@RestController
@RequestMapping("/project")
public class ProjectController extends BaseController {

    @Resource
    private ProjectsService projectsService;

    @GetMapping(value = "/getProjectList")
    public ApiRest<List<Projects>> getProjectList() {
        List<Projects> projectsList = projectsService.getProjectsList();
        return success("获取成功", projectsList);
    }
}
